/*============================================================================
#     FileName: seqlist.h
#       Author: Huoty
#        Email: sudohuoty@163.com
#     HomePage: http://konghy.blog.163.com/
#      Version: 0.0.1
#   CreateDate: 2014-12-19 14:59:41
#      History: 
#  Description: 顺序存储序列
============================================================================*/

#ifndef SEQLIST_H
#define SEQLIST_H

/* 定义存储的数据类型 */
typedef struct {
    char *key;
    char *val;
} KVData_t;

/* 重定义存储的数据类型 */
typedef KVData_t DataType;

/******** 顺序序列 ********/
/* define sequential list */
typedef struct {
    int max;        // maximum list length
    int len;        // real list length
    DataType *slp;  // sequential list pointer
} SeqList;


int seqlist_init(SeqList *seql);
void seqlist_destroy(SeqList *seql);
int seqlist_add_data(SeqList *seql, char *key, char *val);
void seqlist_data_sort(SeqList *seql);
char *seqlist_data_search(SeqList *seql, const char *key);

#endif /* !SEQLIST_H */


/*********************** (C) COPYRIGHT HOUTY PRIVATE *****END OF FILE****/

